//
// CTextureMem.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CTextureMem extends ITexture {
  private long swigCPtr;

  public CTextureMem(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CTextureMem_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTextureMem obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTextureMem(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CTextureMem() {
    this(nel3dJNI.new_CTextureMem__SWIG_0(), true);
  }

  public CTextureMem(SWIGTYPE_p_unsigned_char data, long length, boolean _delete, boolean isFile, long width, long height, SWIGTYPE_p_NL3D__CBitmap__TType texType) {
    this(nel3dJNI.new_CTextureMem__SWIG_1(SWIGTYPE_p_unsigned_char.getCPtr(data), length, _delete, isFile, width, height, SWIGTYPE_p_NL3D__CBitmap__TType.getCPtr(texType)), true);
  }

  public CTextureMem(SWIGTYPE_p_unsigned_char data, long length, boolean _delete, boolean isFile, long width, long height) {
    this(nel3dJNI.new_CTextureMem__SWIG_2(SWIGTYPE_p_unsigned_char.getCPtr(data), length, _delete, isFile, width, height), true);
  }

  public CTextureMem(SWIGTYPE_p_unsigned_char data, long length, boolean _delete, boolean isFile, long width) {
    this(nel3dJNI.new_CTextureMem__SWIG_3(SWIGTYPE_p_unsigned_char.getCPtr(data), length, _delete, isFile, width), true);
  }

  public CTextureMem(SWIGTYPE_p_unsigned_char data, long length, boolean _delete, boolean isFile) {
    this(nel3dJNI.new_CTextureMem__SWIG_4(SWIGTYPE_p_unsigned_char.getCPtr(data), length, _delete, isFile), true);
  }

  public CTextureMem(SWIGTYPE_p_unsigned_char data, long length, boolean _delete) {
    this(nel3dJNI.new_CTextureMem__SWIG_5(SWIGTYPE_p_unsigned_char.getCPtr(data), length, _delete), true);
  }

  public void setPointer(SWIGTYPE_p_unsigned_char data, long length, boolean _delete, boolean isFile, long width, long height, SWIGTYPE_p_NL3D__CBitmap__TType texType) {
    nel3dJNI.CTextureMem_setPointer__SWIG_0(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(data), length, _delete, isFile, width, height, SWIGTYPE_p_NL3D__CBitmap__TType.getCPtr(texType));
  }

  public void setPointer(SWIGTYPE_p_unsigned_char data, long length, boolean _delete, boolean isFile, long width, long height) {
    nel3dJNI.CTextureMem_setPointer__SWIG_1(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(data), length, _delete, isFile, width, height);
  }

  public void setPointer(SWIGTYPE_p_unsigned_char data, long length, boolean _delete, boolean isFile, long width) {
    nel3dJNI.CTextureMem_setPointer__SWIG_2(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(data), length, _delete, isFile, width);
  }

  public void setPointer(SWIGTYPE_p_unsigned_char data, long length, boolean _delete, boolean isFile) {
    nel3dJNI.CTextureMem_setPointer__SWIG_3(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(data), length, _delete, isFile);
  }

  public void setPointer(SWIGTYPE_p_unsigned_char data, long length, boolean _delete) {
    nel3dJNI.CTextureMem_setPointer__SWIG_4(swigCPtr, this, SWIGTYPE_p_unsigned_char.getCPtr(data), length, _delete);
  }

  public SWIGTYPE_p_unsigned_char getPointer() {
    long cPtr = nel3dJNI.CTextureMem_getPointer(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false);
  }

  public long getLength() {
    return nel3dJNI.CTextureMem_getLength(swigCPtr, this);
  }

  public boolean isDeletable() {
    return nel3dJNI.CTextureMem_isDeletable(swigCPtr, this);
  }

  public void doGenerate(boolean async) {
    nel3dJNI.CTextureMem_doGenerate__SWIG_0(swigCPtr, this, async);
  }

  public void doGenerate() {
    nel3dJNI.CTextureMem_doGenerate__SWIG_1(swigCPtr, this);
  }

  public boolean supportSharing() {
    return nel3dJNI.CTextureMem_supportSharing(swigCPtr, this);
  }

  public String getShareName() {
    return nel3dJNI.CTextureMem_getShareName(swigCPtr, this);
  }

  public void setShareName(String shareName) {
    nel3dJNI.CTextureMem_setShareName(swigCPtr, this, shareName);
  }

  public boolean allowDegradation() {
    return nel3dJNI.CTextureMem_allowDegradation(swigCPtr, this);
  }

  public void setAllowDegradation(boolean allow) {
    nel3dJNI.CTextureMem_setAllowDegradation(swigCPtr, this, allow);
  }

  public void serial(IStream arg0) {
    nel3dJNI.CTextureMem_serial(swigCPtr, this, IStream.getCPtr(arg0), arg0);
  }

  public static ITexture Create1x1WhiteTex() {
    long cPtr = nel3dJNI.CTextureMem_Create1x1WhiteTex();
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public long getImageWidth() {
    return nel3dJNI.CTextureMem_getImageWidth(swigCPtr, this);
  }

  public long getImageHeight() {
    return nel3dJNI.CTextureMem_getImageHeight(swigCPtr, this);
  }

}
